//检查登录用户是否是教师或管理员
const {checkTeacherOrAdmin}=require("./auth_checker");


module.exports = function(app)  {
    //以/teacher开头的路由需要权限
    // app.use('/teacher',checkTeacherOrAdmin);

    //无需权限的路由
    app.use('/', require('./routes/index'));
    app.use('/user', require('./routes/user'));
    app.use('/file', require('./routes/file'));
    app.use('/config', require('./routes/config'));
    app.use('/wechat', require('./routes/wechat')); //微信服务，将来需要移植到单独项目中
    app.use('/api/v1', require('./routes/api_v1'));
    app.use('/api/v2', require('./routes/api_v2')); //新增的增强型API
    app.use('/device', require('./routes/device'));
    app.use('/assets', require('./routes/assets'));

    //需要教师以上权限的路由以'/teacher'开头
    app.use('/teacher/crypto', require('./routes/teacher/crypto'));
    app.use('/teacher/name_list', require('./routes/teacher/name_list'));
    app.use('/teacher/name_lists', require('./routes/teacher/name_lists'));
    app.use('/teacher/user', require('./routes/teacher/user'));
    app.use('/teacher/kind', require('./routes/teacher/kind'));
    app.use('/teacher/good', require('./routes/teacher/good'));
    app.use('/teacher/white_list', require('./routes/teacher/white_list'));
    app.use('/teacher/borrow_time', require('./routes/teacher/borrow_time'));
    app.use('/teacher/bind', require('./routes/teacher/bind'));
    app.use('/teacher/cabinet', require('./routes/teacher/cabinet'));
        app.use('/device', require('./routes/device'));
    app.use('/assets', require('./routes/assets'));
    //短信
    app.use('/teacher/ali_msg', require('./routes/teacher/ali_msg'));

};